<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="./vue.js"></script>
  </head>
  <body>
    <div class="app">
      <ul>
        <li v-for="item in list" :key="item.id">{{item.type}}</li>
      </ul>
      <button @click="change">走一走</button>
    </div>
    <script>
      const app = new Vue({
        el: ".app",
        data: {
          list: [
            { id: 1, type: "帅哥" },
            { id: 2, type: "美女" },
            { id: 3, type: "程序员" },
          ],
          newarr: [],
        },
        methods: {
          change() {
            const firstStr = this.list[0];
            this.list.shift();
            this.list.push(firstStr);
          },
        },
      });
    </script>
  </body>
</html>
